home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-07-28 | 4.0 KB | 210 lines | [TEXT/MPS ] |
- /*
- File: Recipient.cp
-
- Copyright: © 1991-1994 by Apple Computer, Inc.
- All rights reserved.
-
- Part of the AOCE Sample SMSAM Package. Consult the license
- which came with this software for your specific legal rights.
-
- */
-
-
-
- #ifndef __BLJSTANDARDINCLUDES__
- #include "BLJStandardIncludes.h"
- #endif
-
- #ifndef __BLJOCEUTILITIES__
- #include "BLJOCEUtilities.h"
- #endif
-
- #ifndef __DEBUGGINGGEAR__
- #include "DebuggingGear.h"
- #endif
-
- #ifndef __RECIPIENT__
- #include "Recipient.h"
- #endif
-
- #pragma segment TRecipient
-
- ImplementList(TRecipient,TRecipientList,true);
-
- /***********************************|****************************************/
-
- ostream& TRecipient::Describe(ostream& s) const
- {
- TRString name, type;
-
- if (this == nil) {
- s << "TRecipient: nil" << flush;
- return s;
- }
-
- if (GetRecipientName (name)) {
- s << name << " ";
- }
-
- if (keithFlag.Flag(4) && GetRecipientType (type)) {
- s << "<" << type << "> ";
- }
-
- if (GetResponsible())
- s << "(R) " << flush;
- else
- s << "(N) " << flush;
-
- if (keithFlag.Flag(4)) {
- CreationID cid;
- if (keithFlag.Flag(4) && GetCID(cid)) {
- s << cid << flush;
- }
-
- if ( IsPathInfoPresent () )
- {
- { unsigned long dNode;
- if (GetPathDNode(dNode)) {
- s << "dNode=" << dNode << " " << flush;
- }
- else
- {
- unsigned short pathCount = GetPathNameCount();
- s << "'" << flush;
- for (short index = 1; index <= pathCount; ++index) {
- TRString r;
- GetPathNameItem (index, r);
- s << r << ":" << flush;
- }
- s << "'" << flush;
-
- s << endl;
- }
- }
-
- if ( IsPathInfoOptional () )
- s << "(Optional) ";
- }
- else
- {
- s << "(No path) ";
- }
-
- { DirectoryName directoryName;
- if (GetDirectoryName(directoryName))
- s << " (" << directoryName << ") " << flush;
- }
-
- if ( IsAddressTypePresent() )
- {
- { OSType addressType = GetAddressType();
-
- s << "'"; OutputOSType (s, addressType); s << "' " << GetExtensionDataSize() << " " << flush;
- }
-
- { char buffer[48];
- GetExtensionData (0, (void *) buffer, 48);
-
- s << "xtnValue=<";
-
- for (int i = 0; i < GetExtensionDataSize(); ++i) {
- unsigned char c = *(buffer + i);
-
- if (c < 0x80) {
- switch (c) {
- case 0: s << "^@"; break;
- case 10: s << "<lf>"; break;
- case 13: s << "<cr>"; break;
- case 27: s << "<esc>"; break;
- default: s << c; break;
- }
- } else {
- s << "<" << hexo << "$" << (unsigned int) c << deco << ">";
- }
- }
- s << "> ";
- }
- }
-
- DescribeSubclass (s);
-
- s << endl;
- }
- return s;
- }
-
- /***********************************|****************************************/
-
- ostream& TRecipient::DescribeSubclass( ostream& s ) const
- {
- return s;
- }
-
- /***********************************|****************************************/
-
- // This probably will never be called
- ostream& TRecipient::operator >> ( ostream& s ) const
- {
- TRString name;
-
- if (this == nil) {
- s << "TRecipient: nil" << flush;
- return s;
- }
-
- s << "TRecpt: '";
- if (GetRecipientName (name)) {
- s << name << " ";
- }
-
- s << "' status=" << GetStatus() << flush;
-
- return s;
- }
-
- /***********************************|****************************************/
-
- TRecipient::TRecipient ()
- {
- }
-
- /***********************************|****************************************/
-
- TRecipient::~TRecipient ()
- {
- }
-
- /***********************************|****************************************/
-
- Boolean TRecipient::GetDirectoryName (DirectoryName&) const
- {
- return false;
- }
-
- /***********************************|****************************************/
-
- unsigned short TRecipient::GetPathNameCount () const
- {
- return 0;
- }
-
- /***********************************|****************************************/
-
- void TRecipient::GetPathNameItem (unsigned short, TRString& ) const
- {
- }
-
- /***********************************|****************************************/
-
- Boolean TRecipient::GetPathDNode (unsigned long& ) const
- {
- return false;
- }
-
- /***********************************|****************************************/
-
- Boolean TRecipient::GetCID (CreationID& ) const
- {
- return false;
- }
-